home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-08 | 28.2 KB | 849 lines | [TEXT/CWIE] |
- //
- // GrayCouncilMA
- // Copyright ©1996 by Trygve Isaacson. All Rights Reserved.
- //
- // MacApp adapter classes for core Gray Council.
- //
- // Before using any of the GrayCouncil source code, read and
- // follow the licensing info in the accompanying documentation
- // or contact:
- // <trygve@kagi.com>
- // <http://www.kagi.com/authors/trygve/>
- //
- // GrayCouncil provides a set of standard C++ classes that implement
- // the standard Apple Grayscale Appearance. The core classes do not
- // require any other code such as a particular class framework.
- //
- // This file defines a set of helper classes that derive from standard
- // MacApp view classes, and interface with the core Gray Council code.
- // There are also a couple of adorner subclasses for attaching to windows
- // and list boxes to get the correct background color or target border.
- //
- // Normally, to use a GrayCouncil MacApp class, you can simply change the
- // class name of the subview in your resource file or AdLib view to the
- // class name of the appropriate Gray Council MacApp adapter class. For
- // example, to use the GC pushbutton, create a normal TButton subview,
- // and set its class name to AGAPushButtonMA. Voila.
- //
- // A couple of the classes use the userData field of the subview to specify
- // additional information such as icon IDs, string resource IDs, etc.
- //
- // To statically instantiate one of these MacApp subclasses at runtime,
- // not via a view resource, use the class' supplied "I" method.
- //
- // Each class here that interfaces to a core AGAObject has a public
- // member variable called mAGAObject that points to the actual AGAObject
- // subclass object. Certain extended object settings (such as mixed-state
- // buttons, proportional and live scrolling, etc.) require you to call
- // the AGAObject to set it. The member variable is made public to keep
- // these MacApp classes as lightweight as possible; you make the call,
- // rather than using myriad new functions of the MacApp AGA subclasses.
- //
- // Classes defined below:
- // AGAPushButtonMA -- TButton subclass for AGAPushButton
- // AGACheckBoxMA -- TCheckBox subclass for AGACheckBox
- // AGARadioButtonMA -- TRadio subclass for AGARadioButton
- // AGAIconPushButtonMA -- AGAPushButtonMA (TButton) subclass for AGAIconPushButton
- // AGAIconCheckBoxMA -- AGACheckBoxMA (TCheckBox) subclass for AGAIconCheckBox
- // AGAIconRadioButtonMA -- AGARadioButtonMA (TRadio) subclass for AGAIconRadioButton
- // AGAScrollBarMA -- TScrollBar subclass for AGAScrollBar
- // AGAScrollerScrollBarMA -- TScrollerScrollBar subclass for AGAScrollBar
- // Remember the difference between TScrollBar and TScrollerScrollBar!
- // AGASliderMA -- TControl subclass for AGASlider
- // AGABackgroundAdornerMA -- TAdorner subclass that you should attach to
- // typical modeless windows; gives it the proper modeless gray background
- // AGAModalBackgroundAdornerMA -- AGABackgroundAdornerMA (TAdorner) subclass
- // that you should attach to modal windows (i.e., things you PoseModally);
- // gives it the proper modal gray background
- // AGAWhiteBackgroundAdornerMA -- TAdorner subclass you should attach to any
- // view that needs a white background but lives in a gray background window
- // (e.g., TEditText, TScroller containing grid, etc.)
- // AGABorderFrameAdornerMA -- TAdorner subclass that you can attach to any
- // view that needs a "3D" sunken frame around it (e.g., the same things
- // that need a white background adorner)
- // AGAPopupMA -- TPopup subclass for AGAPopupMenu
- // AGAStaticTextMA -- TStaticText subclass for AGAStaticText
- // AGALittleArrowsMA -- TControl subclass for AGALittleArrows
- // AGADisclosureTriangleMA -- TControl subclass for AGADisclosureTriangle
- // AGAProgressIndicatorMA -- TControl subclass for AGAProgressIndicator
- // AGASeparatorMA -- TView subclass for AGASeparator
- // AGATargetBorderViewMA -- TTargetBorderView subclass that draws AGA-style
- // target border frame
- // AGATargetBorderFrameViewMA -- AGATargetBorderViewMA (TTargetBorderView)
- // subclass that draws a "3D" sunken frame just like an AGABorderFrameAdornerMA
- // in addition to the AGA-compatible TTargetBorderView.
- // AGAGroupBoxMA -- TCluster subclass for AGAGroupBox
- // AGASecondaryGroupBoxMA -- AGAGroupBoxMA (TCluster) subclass for AGAGroupBox
- // with secondary box style set
- //
-
- #ifndef __GRAYCOUNCILMA__
- #define __GRAYCOUNCILMA__
-
- #include "GrayCouncil.h"
- #include "UDialog.h"
-
- //
- // You must call InitGrayCouncilMA after initializing the MacApp and the
- // Toolbox and before instantiating any GrayCouncil objects. This routine
- // registers the MacApp classes and then calls the core InitGrayCouncil
- // function for you. If it returns an error, you should quit. The only
- // current error situation of this is an out-of-memory condition
- // during initialization.
- //
-
- extern OSErr InitGrayCouncilMA();
-
- //
- // AGAPushButtonMA ----------------------------------------------------
- //
- // TButton replacement subclass. Automatically detects presence of a
- // TRRectAdorner to make the AGAPushButton take on the default button
- // appearance. You could also set kIsDefault state manually.
- //
-
- class AGAPushButtonMA : public TButton
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGAPushButtonMA();
- virtual ~AGAPushButtonMA();
-
- // TButton-compatible I method
- void IAGAPushButtonMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel);
-
- // MacApp overrides
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
- virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
- virtual void HiliteState(Boolean state, Boolean redraw);
- virtual void Hilite();
- virtual void DimState(Boolean state, Boolean redraw);
- virtual void Dim();
-
- AGAPushButton* mAGAObject;
-
- protected:
-
- virtual void CreateAGAObject();
-
- TAdorner* FindRRectAdorner();
- };
-
- //
- // AGACheckBoxMA ----------------------------------------------------
- //
- // TCheckBox replacement subclass. To use mixed-state capability,
- // set/get the AGACheckBox state directly.
- //
-
- class AGACheckBoxMA : public TCheckBox
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGACheckBoxMA();
- virtual ~AGACheckBoxMA();
-
- // TCheckBox-compatible I method
- void IAGACheckBoxMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel, Boolean isTurnedOn);
-
- // MacApp overrides
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
- virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
- virtual void HiliteState(Boolean state, Boolean redraw);
- virtual void Hilite();
- virtual void DimState(Boolean state, Boolean redraw);
- virtual void Dim();
- virtual Boolean IsOn();
- virtual void SetState(Boolean state, Boolean redraw);
- virtual void Toggle(Boolean redraw);
- virtual void ToggleIf(Boolean matchState, Boolean redraw);
-
- AGACheckBox* mAGAObject;
-
- protected:
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGARadioButtonMA ----------------------------------------------------
- //
- // TRadio replacement subclass. To use mixed-state capability,
- // set/get the AGARadioButton state directly.
- //
-
- class AGARadioButtonMA : public TRadio
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGARadioButtonMA();
- virtual ~AGARadioButtonMA();
-
- // TRadio-compatible I method
- void IAGARadioButtonMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel, Boolean isTurnedOn);
-
- // MacApp overrides
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
- virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
- virtual void HiliteState(Boolean state, Boolean redraw);
- virtual void Hilite();
- virtual void DimState(Boolean state, Boolean redraw);
- virtual void Dim();
- virtual Boolean IsOn();
- virtual void SetState(Boolean state, Boolean redraw);
- virtual void Toggle(Boolean redraw);
- virtual void ToggleIf(Boolean matchState, Boolean redraw);
-
- AGARadioButton* mAGAObject;
-
- protected:
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGAIconPushButtonMA ----------------------------------------------------
- //
- // TButton replacement subclass that implements an icon button that behaves
- // like a TButton -- you click it and it sends its fEventNumber. When
- // instantiated from a view resource, the fUserArea is used to obtain the
- // button's icon ID. You can also set the icon ID of the AGAIconPushButton
- // directly (cast the mAGAObject to AGAIconPushButton*).
- //
-
- class AGAIconPushButtonMA : public AGAPushButtonMA
- {
- MA_DECLARE_CLASS;
-
- // TButton-compatible I method
- void IAGAIconPushButtonMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel);
-
- protected:
-
- // AGAPushButtonMA override
- virtual void CreateAGAObject();
- };
-
- //
- // AGAIconCheckBoxMA ----------------------------------------------------
- //
- // TCheckBox replacement subclass that implements an icon button that behaves
- // like a check box -- you click it and it toggles its on/off state. When
- // instantiated from a view resource, the fUserArea is used to obtain the
- // button's icon ID. You can also set the icon ID of the AGAIconCheckBox
- // directly (cast the mAGAObject to AGAIconCheckBox*). If you want the on/off
- // states to have different icons, you can specify different icon IDs.
- //
-
- class AGAIconCheckBoxMA : public AGACheckBoxMA
- {
- MA_DECLARE_CLASS;
-
- // TCheckBox-compatible I method
- void IAGAIconCheckBoxMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel, Boolean isTurnedOn);
-
- protected:
-
- // AGACheckBoxMA override
- virtual void CreateAGAObject();
- };
-
- //
- // AGAIconRadioButtonMA ----------------------------------------------------
- //
- // TRadio replacement subclass that implements an icon button that behaves
- // like a radio button -- you click it and it turns on, and notifies its
- // cluster so that the others in its group are turned off. When
- // instantiated from a view resource, the fUserArea is used to obtain the
- // button's icon ID. You can also set the icon ID of the AGAIconRadioButton
- // directly (cast the mAGAObject to AGAIconRadioButton*). If you want the on/off
- // states to have different icons, you can specify different icon IDs.
- //
-
- class AGAIconRadioButtonMA : public AGARadioButtonMA
- {
- MA_DECLARE_CLASS;
-
- // TRadio-compatible I method
- void IAGAIconRadioButtonMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const CStr255& itsLabel, Boolean isTurnedOn);
-
- protected:
-
- // AGARadioButtonMA override
- virtual void CreateAGAObject();
- };
-
- //
- // AGAScrollBarMA ----------------------------------------------------
- //
- // TScrollBar replacement subclass. To use live scrolling, set the
- // AGAScrollBar state directly and either install a notification routine
- // or handle the scroll bar's fEventNumber by checking the current value.
- // To use proportional indicator, set the AGAScrollBar state directly.
- //
- // Please note that TScrollBar and TScrollerScrollBar are different!
- //
-
- typedef void (*AGANotifyMAPtr)(TView* theIndicator, SInt32 dataValue, void* userData);
-
- class AGAScrollBarMA : public TScrollBar
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGAScrollBarMA();
- virtual ~AGAScrollBarMA();
-
- // TScrollBar-compatible I method
- void IAGAScrollBarMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, VHSelect itsDirection, long itsVal, long itsMin, long itsMax);
-
- // MacApp overrides
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
- virtual void SetLongVal(VCoordinate itsVal, Boolean redraw);
- virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
- virtual void HiliteState(Boolean state, Boolean redraw);
- virtual void Hilite();
- virtual void DimState(Boolean state, Boolean redraw);
- virtual void Dim();
- virtual void Activate(Boolean entering);
- virtual void SetLongMax(VCoordinate itsMax, Boolean redraw);
-
- virtual void InstallNotificationRoutine(AGANotifyMAPtr notificationRoutine, void* userData);
- virtual void HandleNotification(SInt32 dataValue);
-
- AGANotifyMAPtr mNotificationRoutine;
- void* mUserData;
-
- AGAScrollBar* mAGAObject;
-
- protected:
-
- virtual void CreateAGAObject();
-
- static void RealAGANotifier(AGATrackingIndicator* theIndicator, SInt32 dataValue, void* userData);
- };
-
- //
- // AGAScrollerScrollBarMA ----------------------------------------------------
- //
- // TScrollerScrollBar replacement subclass. To use live scrolling, just set
- // the AGAScrollBar state directly; the scroller will get the live scroll
- // nofication messages automatically. To use proportional indicator,
- // set the AGAScrollBar state directly.
- //
- // Please note that TScrollBar and TScrollerScrollBar are different!
- //
-
- class AGAScrollerScrollBarMA : public TScrollerScrollBar
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGAScrollerScrollBarMA();
- virtual ~AGAScrollerScrollBarMA();
-
- // TScrollerScrollBar-compatible I method
- void IAGAScrollerScrollBarMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, VHSelect itsDirection, long itsMax, TScroller* itsScroller);
-
- // MacApp overrides
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
- virtual void AttachScroller(TScroller* itsScroller);
- virtual void SetLongVal(VCoordinate itsVal, Boolean redraw);
- virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
- virtual void HiliteState(Boolean state, Boolean redraw);
- virtual void Hilite();
- virtual void DimState(Boolean state, Boolean redraw);
- virtual void Dim();
- virtual void Activate(Boolean entering);
- virtual void SetLongMax(VCoordinate itsMax, Boolean redraw);
-
- virtual void InstallNotificationRoutine(AGANotifyMAPtr notificationRoutine, void* userData);
- virtual void HandleNotification(SInt32 dataValue);
- virtual void UpdateScrollAmounts();
-
- AGANotifyMAPtr mNotificationRoutine;
- void* mUserData;
-
- AGAScrollBar* mAGAObject;
-
- protected:
-
- virtual void CreateAGAObject();
-
- static void RealAGANotifier(AGATrackingIndicator* theIndicator, SInt32 dataValue, void* userData);
- };
-
- //
- // AGASliderMA ----------------------------------------------------
- //
- // TControl subclass. To set/get the value, access the AGASlider
- // directly. When instantiated from a view resource, the fUserArea,
- // if non-zero, is used as the resource ID of an 'STR#' resource
- // that contains the slider labels; in this case, the range is
- // automatically set to match the number of labels, and the slider
- // will have a pointy indicator. If the ID is zero or invalid, the
- // slider will be rectangular.
- //
-
- class AGASliderMA : public TControl
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGASliderMA();
- virtual ~AGASliderMA();
-
- // TControl-compatible I method
- void IAGASliderMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
-
- // MacApp overrides
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
- virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
- virtual void DimState(Boolean state, Boolean redraw);
- virtual void Dim();
-
- AGASlider* mAGAObject;
-
- protected:
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGABackgroundAdornerMA ----------------------------------------------------
- //
- // An adorner that you should attach to typical modeless windows if you
- // want the standard AGA gray background. It should be placed BEFORE the
- // "Draw Adorner".
- //
-
- class AGABackgroundAdornerMA : public TAdorner
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGABackgroundAdornerMA();
-
- // MacApp overrides
- virtual void DoHighlightSelection(TView* itsView, const VRect& area, HLState fromHL, HLState toHL);
- virtual void Draw(TView* itsView, const VRect& area);
- virtual void ViewChangedFrame(TView* itsView, const VRect& oldFrame, const VRect& newFrame, Boolean invalidate);
-
- protected:
-
- virtual void DrawBackground(TView* itsView, const VRect& area, Boolean fill, Boolean active);
- virtual Boolean HasGrowBox(TView* itsView);
-
- enum { kBGFill, kBGActiveLight, kBGActiveShadow, kBGInactiveLight, kBGInactiveShadow, kBGNumIndexes };
-
- SInt32 mRampIndexes[kBGNumIndexes];
- };
-
- //
- // AGAModalBackgroundAdornerMA ----------------------------------------------------
- //
- // An adorner that you should attach to typical modal windows (dialogs)
- // in order to get the standard AGA modal gray background. It should be placed
- // BEFORE the "Draw Adorner".
- //
-
- class AGAModalBackgroundAdornerMA : public AGABackgroundAdornerMA
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGAModalBackgroundAdornerMA();
-
- protected:
-
- virtual void DrawBackground(TView* itsView, const VRect& area, Boolean fill, Boolean active);
- };
-
- //
- // AGAWhiteBackgroundAdornerMA ----------------------------------------------------
- //
- // An adorner that you should attach to any subview where the window has
- // a gray background but the particular subview needs a white background.
- // Editable text fields and list boxes are the most common examples. It should
- // be placed BEFORE the "Draw Adorner".
- //
-
- class AGAWhiteBackgroundAdornerMA : public TAdorner
- {
- MA_DECLARE_CLASS;
-
- public:
-
- // MacApp overrides
- virtual void Draw(TView* itsView, const VRect& area);
- };
-
- //
- // AGABorderFrameAdornerMA ----------------------------------------------------
- //
- // An adorner that you should attach to any subview where the subview
- // needs a "3D" sunken frame around it. Editable text fields and list
- // boxes are the most common examples. It should be placed AFTER the
- // "Draw Adorner".
- //
-
- class AGABorderFrameAdornerMA : public TAdorner
- {
- MA_DECLARE_CLASS;
-
- public:
-
- // MacApp overrides
- virtual void Draw(TView* itsView, const VRect& area);
- };
-
- //
- // AGAPopupMA ----------------------------------------------------
- //
- // TPopup replacement subclass.
- //
-
- class AGAPopupMA : public TPopup
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGAPopupMA();
- virtual ~AGAPopupMA();
-
- // TPopup-compatible I method
- void IAGAPopupMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, short itsMenuID, short itsCurrentItem, short itsItemOffset, short itsStrListID, short itsIndex, short itsStyle, short itsJust, Boolean useAddResMenu, ResType useAddResMenuResType, const TextStyle& itsTextStyle = gSystemStyle);
-
- // MacApp overrides
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
- virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
- virtual void DimState(Boolean state, Boolean redraw);
- virtual void Dim();
-
- // TPopup and TControl overrides
- virtual void AttachMenuRef(MenuRef itsMenuRef); // installs the menu
- virtual void SetText(const CStr255& title, Boolean redraw); // sets the popup title
- virtual void SetLongVal(VCoordinate itsVal, Boolean redraw);// sets cur item no
- virtual SInt16 GetVal(); // gets cur item no
-
- AGAPopupMenu* mAGAObject;
-
- protected:
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGAStaticTextMA ----------------------------------------------------
- //
- // TStaticText replacement subclass. Dims with gray text instead of
- // patBic gray pattern erasing; suppresses erasing background to white
- // when text is changed.
- //
-
- class AGAStaticTextMA : public TStaticText
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGAStaticTextMA();
- virtual ~AGAStaticTextMA();
-
- // TStaticText-compatible I method
- void IAGAStaticTextMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, ResNumber itsRsrcID, short itsIndex);
-
- // MacApp overrides
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
- virtual void DimState(Boolean state, Boolean redraw);
- virtual void Dim();
- virtual void SetText(const CStr255& theText, Boolean redraw);
-
- AGAStaticText* mAGAObject;
-
- protected:
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGALittleArrowsMA ----------------------------------------------------
- //
- // TControl subclass. You will need to either install a notification
- // routine to respond to arrow tracking, or subclass and override
- // the HandleNotification member function. However:
- //
- // If you simply want to link the little arrows to a TNumberText
- // field, just put the TNumberText's view ID the little arrows view's
- // fUserArea, and the arrows will automatically increment/decrement
- // the TNumberText view's value.
- //
-
- class AGALittleArrowsMA : public TControl
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGALittleArrowsMA();
- virtual ~AGALittleArrowsMA();
-
- // TControl-compatible I method
- void IAGALittleArrowsMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
-
- // MacApp overrides
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
- virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
- virtual void DimState(Boolean state, Boolean redraw);
- virtual void Dim();
-
- virtual void InstallNotificationRoutine(AGANotifyMAPtr notificationRoutine, void* userData);
- virtual void HandleNotification(SInt32 deltaValue);
-
- AGANotifyMAPtr mNotificationRoutine;
- void* mUserData;
-
- AGALittleArrows* mAGAObject;
-
- protected:
-
- virtual void CreateAGAObject();
-
- static void RealAGANotifier(AGALittleArrows* theAGAObject, SInt32 deltaValue, void* userData);
-
- TNumberText* mLinkedNumberText;
- };
-
- //
- // AGADisclosureTriangleMA ----------------------------------------------------
- //
- // TControl subclass. Set/get the AGADisclosureTriangle state
- // directly. Think of it as a check box -- it's either on or off.
- //
-
- class AGADisclosureTriangleMA : public TControl
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGADisclosureTriangleMA();
- virtual ~AGADisclosureTriangleMA();
-
- // TControl-compatible I method
- void IAGADisclosureTriangleMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
-
- // MacApp overrides
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
- virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
- virtual void DimState(Boolean state, Boolean redraw);
- virtual void Dim();
-
- AGADisclosureTriangle* mAGAObject;
-
- protected:
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGAProgressIndicatorMA ----------------------------------------------------
- //
- // TControl subclass. Access the AGAProgressIndicator directly. For
- // determinate progress, set the min/max range, and then call SetValue
- // or Increment repeatedly; you can also update the origin value if
- // desired. For indeterminate progress, set min=max and then call Animate
- // repeatedly.
- //
-
- class AGAProgressIndicatorMA : public TControl
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGAProgressIndicatorMA();
- virtual ~AGAProgressIndicatorMA();
-
- // TControl-compatible I method
- void IAGAProgressIndicatorMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, const TextStyle& itsTextStyle = gSystemStyle);
-
- // MacApp overrides
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
- virtual void DimState(Boolean state, Boolean redraw);
- virtual void Dim();
-
- AGAProgressIndicator* mAGAObject;
-
- protected:
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGASeparatorMA ----------------------------------------------------
- //
- // TView subclass. The precise width or height is irrelevant; the
- // longer of the two dimensions determines the separator direction,
- // and the separator is drawn along the top or left edge.
- //
-
- class AGASeparatorMA : public TView
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGASeparatorMA();
- virtual ~AGASeparatorMA();
-
- // TView-compatible I method
- void IAGASeparatorMA(TDocument* itsDocument, TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet);
-
- // MacApp overrides
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
-
- AGASeparator* mAGAObject;
-
- protected:
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGATargetBorderViewMA ----------------------------------------------------
- //
- // TTargetBorderView replacement subclass.
- //
-
- class AGATargetBorderViewMA : public TTargetBorderView
- {
- MA_DECLARE_CLASS;
-
- public:
-
- // TTargetBorderView-compatible I method
- void IAGATargetBorderViewMA(TDocument* itsDocument, TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, IDType itsTargetView);
-
- // MacApp overrides
- virtual void Draw(const VRect& area);
- virtual void ComputeBorderRegion(RgnHandle borderRegion);
- };
-
- //
- // AGATargetBorderFrameViewMA ----------------------------------------------------
- //
- // TTargetBorderView replacement subclass that also draws a
- // AGABorderFrameAdornerMA-type "3D" sunken frame. Provided
- // for convenience: makes it unnecessary to attach an
- // AGABorderFrameAdornerMA to the subview that this target
- // border view surrounds.
- //
-
- class AGATargetBorderFrameViewMA : public AGATargetBorderViewMA
- {
- MA_DECLARE_CLASS;
-
- public:
-
- // TTargetBorderView-compatible I method
- void IAGATargetBorderFrameViewMA(TDocument* itsDocument, TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, IDType itsTargetView);
-
- // MacApp overrides
- virtual void Draw(const VRect& area);
- virtual void Dim(const VRect& area);
- virtual void SetEnable(Boolean state);
- };
-
- //
- // AGAGroupBoxMA ----------------------------------------------------
- //
- // TCluster replacement subclass. Defaults to primary group box
- // type.
- //
-
- class AGAGroupBoxMA : public TCluster
- {
- MA_DECLARE_CLASS;
-
- public:
-
- AGAGroupBoxMA();
- virtual ~AGAGroupBoxMA();
-
- // TCluster-compatible I method
- void IAGAGroupBoxMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, ResNumber itsRsrcID, short itsIndex);
-
- // MacApp overrides
- virtual void DoPostCreate(TDocument* itsDocument);
- virtual void Draw(const VRect& area);
- virtual void SetFrame(const VRect& newFrame, Boolean invalidate);
- virtual void DoMouseCommand(VPoint& theMouse, TToolboxEvent* event, CPoint hysteresis);
- virtual void DimState(Boolean state, Boolean redraw);
- virtual void Dim();
-
- AGAGroupBox* mAGAObject;
-
- protected:
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGASecondaryGroupBoxMA ----------------------------------------------------
- //
- // TCluster replacement subclass that overrides AGAGroupBoxMA to
- // use secondary group box appearance.
- //
-
- class AGASecondaryGroupBoxMA : public AGAGroupBoxMA
- {
- MA_DECLARE_CLASS;
-
- // TCluster-compatible I method
- void IAGASecondaryGroupBoxMA(TView* itsSuperView, const VPoint& itsLocation, const VPoint& itsSize, SizeDeterminer itsHSizeDet, SizeDeterminer itsVSizeDet, ResNumber itsRsrcID, short itsIndex);
-
- protected:
-
- virtual void CreateAGAObject();
- };
-
- #endif // __GRAYCOUNCILMA__
-
-